<?php
/**
 * IWpRequest.php
 * 
 * This file contains the interface IWpRequest to be used for all types of request
 * @author Robert Schmidt <robert@wildpack.de>
 * @version 1.0
 * @package wildpack
 * @subpackage web.request
 */


/**
 * The interface to be used for all types of request
 * @author Robert Schmidt <robert@wildpack.de>
 * @version 1.0
 * @package wildpack
 * @subpackage web.request
 */
interface IWpRequest
{

	/**
	 * The class constructor
	 * @param object $config[optional] The configuration object.
	 */
	function __construct($config=null);
	
	/**
	 * Checks wether the request contains a file
	 * @param string $name The name of the field, used for the file
	 * @return bool True if the file was sent using the specified field, false else
	 */
	function containsFile($name);
	
	/**
	 * Retrieves the filename of the uploaded file specified by upload field name
	 * @param string $name The name of the field used for file upload
	 * @return The filename of the file specified by field name
	 */
	function getFilename($name);
	
	/**
	 * Retrieves the request header value (if available)
	 * @param string $name The name of the header value to retrieve
	 * @return The header value
	 */
	public function getHeader($name);
	
	/**
	 * Determines wether a parameter is set or not
	 * @param string $name The name of the parameter to check
	 * @return True if the parameter is set, false else
	 */
	function issetParam($name);
	
	/**
	 * Retrieves the value of the parameter specified by name
	 * @param string $name The name of the parameter to return the value of
	 * @return mixed The value of the parameter
	 */
	public function getParam($name);
	
	/**
	 * Retrieves a list of parameter names
	 * @return An array of parameters names
	 */
	public function getParamNames();
	
	/**
	 * Performs a redirect to another location
	 * @param string $location The location to redirect to
	 */
	public function redirect($location);
	
	/**
	 * Saves the file, specified by upload field name to the server
	 * @param string $name The name of the field used for file upload
	 * @param string $path The path to save the file to
	 * @param string $newfilename[optional] The name to use for the file instead of the original one
	 * @return bool True if successfully done, false else
	 */
	public function saveFile($name, $path, $newfilename = '');
}

/* End of file IWpRequest.php */
/* Location: ./wildpack/web/request/IWpRequest.php */ 
